﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LocalhostMap
{
    /// <summary>
    /// SetMapPath 的摘要说明
    /// </summary>
    public class SetMapPath : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            var Path = context.Request["Value"];

            context.Response.Write("Old Value : " + Process.MapPath);

            context.Response.Write("\n");

            if (!string.IsNullOrEmpty(Path))
            {
                Process.MapPath = Path;
            }

            context.Response.Write("New Value : " + Process.MapPath);

            context.Response.Write("\n");

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}